#coding=utf-8
from pymongo import MongoClient
import os
import ConfigParser
class cnkipagemongo:
    def __init__(self):
        self.client=MongoClient("localhost",27017)
        self.db=self.client["klbr"]
        self.collection=self.db["klbr_cnki_resolvedpage"]
    def savepage(self,pagecontent,url,mold,name):
        try:
            content={"url":url,"pagecontent":pagecontent,'name':name,'type':mold}
            print url
            self.collection.insert(content)
        except Exception  as e:
            print "添加失败，url="+url
            print e

